Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Fixes a layout flash issue in the New Workspace page, particularly noticeable on SSH runtime, where auxiliary fields (branch selector, host input) would appear after the initial render.

Background

Two issues were causing layout shifts:

  1. Branch selector flash: The branch selector was hidden initially (branches = []) and appeared after the async listBranches API completed
  2. SSH/Docker field updates: A useEffect in useDraftWorkspaceSettings was firing on initial mount because prevMode = null !== selectedRuntime.mode, causing unnecessary state updates

Implementation

  1. useDraftWorkspaceSettings.ts: Added prevMode !== null check to skip the "restore remembered config" effect on initial mount. The useState initializer already handles correct initial values.

  2. CreationControls.tsx: Added a loading placeholder skeleton that reserves space while branches load. Shows an animated pulse effect during loading state.


Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high • Cost: $2.47

- Skip 'restore remembered config' effect on initial mount since useState
  initializer already handles correct initial values
- Add loading placeholder skeleton for branch selector to reserve space
  while branches load async
@github-actions github-actions bot added the bug label Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant